package com.navinfo.platform.dataanalysis.dto;

import lombok.Data;

import java.io.Serializable;

@Data
public class IdleBean implements Serializable {
    private long tid;
    private int idleTimes;
    private int idleDuration;
    private int idle100kmTimes;
    private int idleDurationProportion;
    private int firstGpsTime;
    private int lastGpsTime;

    public void incrIdleTimes(){
        this.idleTimes++;
    }

    public void incrIdleDuration(int duration){
        this.idleDuration += duration;
    }

    public void clearData(){
       this.firstGpsTime = 0;
       this.lastGpsTime = 0;
    }

    public int calcDuration(int gpsDate){
        if(this.lastGpsTime == 0){
            return 0;
        }
        return gpsDate - this.lastGpsTime;
    }
}
